home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / mx / mx.man < prev    next >
Text File  |  1990-04-19  |  46KB  |  1,017 lines

  1. '\" Copyright 1989 Regents of the University of California
  2. '\" Permission to use, copy, modify, and distribute this
  3. '\" documentation for any purpose and without fee is hereby
  4. '\" granted, provided that this notice appears in all copies.
  5. '\" The University of California makes no representations about
  6. '\" the suitability of this material for any purpose.  It is
  7. '\" provided "as is" without express or implied warranty.
  8. '\" 
  9. '\" $Header: /sprite/src/cmds/mx/RCS/mx.man,v 1.18 90/03/29 11:33:48 ouster Exp $ SPRITE (Berkeley)
  10. '
  11. .so \*(]ltmac.sprite
  12. .HS MX cmds
  13. .BS
  14. .SH NAME
  15. mx \- Mouse-oriented editor for X
  16. .SH SYNOPSIS
  17. \fBmx \fR[\fIoptions\fR]  [\fIfile file file ...\fR]
  18. .br
  19. \fBmxsync \fR[\fIoptions\fR]  [\fIfile file file ...\fR]
  20. .SH OPTIONS
  21. .IP "\fB\-bd \fIcolor\fR" 15
  22. Use \fIcolor\fR as the border color for the window.  If this switch
  23. isn't given then the \fBborderColor\fR X default is used.  If it isn't given
  24. either, then the foreground color is used.
  25. .IP "\fB\-bg \fIcolor\fR" 15
  26. Use \fIcolor\fR as the background color for the window.  If this switch
  27. isn't given then the \fBbackground\fR X default is used.  If it isn't given
  28. either, or if the display is a black-and-white one, then White is used.
  29. .IP "\fB\-D\fR" 15
  30. Causes \fBmx\fR not to detach itself from its parent process.  Useful
  31. when \fBmx\fR is invoke from programs that wait for it to finish,
  32. like mail programs.  If \fBmx\fR is invoked under the name \fBmxsync\fR
  33. then \fBmx\fR acts as if this switch had been given.
  34. .IP "\fB\-display \fIhost\fB:\fIdisplay\fR" 15
  35. .VS
  36. Use \fIhost\fR and \fIdisplay\fR as an indication of the
  37. display on which to open the window.  The display defaults to the
  38. one specified in the \fBDISPLAY\fR environment variable.
  39. .IP "\fB\-f\fR" 15
  40. Treat all remaining arguments as file names.  This option must be
  41. used to
  42. edit a file if its name starts with ``\-'' or ``='' or ``+'' or contains
  43. a ``:'' character.
  44. .VE
  45. .IP "\fB\-fg \fIcolor\fR" 15
  46. Use \fIcolor\fR as the foreground color for the window.  If this switch
  47. isn't given then the \fBforeground\fR X default is used.  If it isn't given
  48. either, or if the display is a black-and-white one, then Black is used.
  49. .IP "\fB\-fn \fIfont\fR" 15
  50. Use \fIfont\fR as the font for the window.  If this switch isn't given,
  51. then the \fBfont\fR X default is used as the font.  If it isn't given
  52. either, then the Sx default font is used.
  53. .IP "\fB\-geometry \fIgeometry\fR" 15
  54. .VS
  55. Use \fIgeometry\fR as the geometry for the window.  If no geometry
  56. is specified on the command line, it the geometry defaults to the value of the
  57. \fBgeometry\fR X default.  If no default is specified, then
  58. \fBmx\fR picks a geometry.
  59. .IP \fB\-help\fR
  60. Print out a list of the command-line options (and brief descriptions
  61. of their functions) and exit without opening a window.
  62. .IP "\fB\-icon \fIfile\fR" 15
  63. \fIFile\fR is the name of a file in bitmap format.  Read the file and
  64. use it as the icon for the window.  If \fIfile\fR is \fBlocalhost\fR,
  65. then \fBmx\fR chooses the default icon file corresponding to the local host.
  66. .IP "\fB\-ix \fIxcoord\fR" 15
  67. Display the icon at x-coordinate \fIxcoord\fR.
  68. .IP "\fB\-iy \fIycoord\fR" 15
  69. Display the icon at y-coordinate \fIycoord\fR.
  70. .VE
  71. .IP "\fB\-sb \fIcolor\fR" 15
  72. Use \fIcolor\fR as the background color for the window's scrollbar.
  73. If this switch isn't given then the \fBscrollbar.background\fR
  74. X default is used.  If it isn't given either, then the background
  75. color for the text window is used.
  76. .IP "\fB\-sf \fIcolor\fR" 15
  77. Use \fIcolor\fR as the foreground color for the window's scrollbar.
  78. If this switch isn't given then the \fBscrollbar.foreground\fR
  79. X default is used.  If it isn't given either, then the foreground
  80. color for the text window is used.
  81. .IP "\fB\-se \fIcolor\fR" 15
  82. Use \fIcolor\fR as the color for the window's scrollbar elevator.
  83. If this switch isn't given then the \fBscrollbar.elevator\fR
  84. X default is used.  If it isn't given either, then the background
  85. color for the text window is used.
  86. .IP "\fB\-showtitle\fR" 15
  87. .VS
  88. Display a title bar at the top of the window.  Mx normally assumes
  89. that a window manager will display a title bar;  if your window
  90. manager doesn't, you may wish to use this switch.  If this switch
  91. isn't specified, then Mx checks for a \fBshowTitle\fR X default;
  92. if it exists and contains the string ``yes'', then a title
  93. bar will be displayed.
  94. .VE
  95. .IP "\fB\-t \fItag\fR" 15
  96. Look up \fItag\fP in the tags file of the current directory, open its
  97. file in the new window, and go to the line of the tag.
  98. .IP "\fB\-tb \fIcolor\fR" 15
  99. Use \fIcolor\fR as the background color for the window's title bar.
  100. If this switch isn't given then the \fBtitle.background\fR
  101. X default is used.  If it isn't given either, then the background
  102. color for the text window is used.  This option is ignored if Mx
  103. isn't displaying a title bar.
  104. .IP "\fB\-tf \fIcolor\fR" 15
  105. Use \fIcolor\fR as the foreground color for the window's title bar.
  106. If this switch isn't given then the \fBtitle.foreground\fR
  107. X default is used.  If it isn't given either, then the foreground
  108. color for the text window is used.  This option is ignored if Mx
  109. isn't displaying a title bar.
  110. .IP "\fB\-ts \fIcolor\fR" 15
  111. Use \fIcolor\fR as the color for the window's title stripes.
  112. If this switch isn't given then the \title.stripe\fR
  113. X default is used.  If it isn't given either, then the foreground
  114. color for the text window is used.  This option is ignored if Mx
  115. isn't displaying a title bar.
  116. .IP "\fB+\fR" 15
  117. Position the file so its last line is visible in the window.
  118. .IP "\fB+\fIlineNumber\fR" 15
  119. After opening the file, select the first character of
  120. line "\fIlineNumber\fP and make that line visible in the window.
  121. For this switch, line 1 corresponds to the first line of the file.
  122. .IP "\fB+\fIsearchPattern\fR" 15
  123. After opening the file, search for \fIsearchPattern\fP, just as if a
  124. \fBsearch\fP command had been invoked.  If the first character of
  125. \fIsearchPattern\fP is a slash then the slash is ignored (this is
  126. for vi compatibility and to permit search patterns that begin with
  127. a digit).
  128. .IP "\fB=\fIgeometry\fR" 15
  129. Use \fIgeometry\fR as the geometry specifier for the window (same effect
  130. as the \fB-geometry option).
  131. .IP "\fIhost:display\fR" 15
  132. Use this argument to select the display on which to create the window
  133. (same effect as the \fB-display\fR option).
  134. .BE
  135. .SH INTRODUCTION
  136. \fBMx\fR is a mouse-oriented editor that uses the facilities of the X window
  137. system, the Sx supplementary library, and the Tcl command interpreter.
  138. .VS
  139. It displays a window containing the first
  140. \fIfile\fP argument and permits \fIfile\fP to be edited using the
  141. commands defined
  142. below.  If no \fIfile\fR is specified, then \fBmx\fR displays a file
  143. containing a tutorial introduction to \fBmx\fR.  If \fIfile\fR
  144. is specified as an empty string, then
  145. \fBmx\fR creates a scratch window without any particular file association.
  146. \fBMx\fR normally detaches itself from its parent (as far as its
  147. parent is concerned, \fBmx\fR will have exited);  if the \fB\-D\fR switch
  148. is given, or if \fBmx\fR is invoked under the name \fBmxsync\fR,
  149. then \fBmx\fR doesn't detach itself from its parent.
  150. .VE
  151. .LP
  152. Almost all \fBmx\fR actions are invoked using Tcl commands.  See the Tcl
  153. documentation for information on the basic command syntax and the
  154. built-in Tcl commands.  \fBMx\fR extends the Tcl built-in commands
  155. with additional commands for file editing;  the \fBmx\fR commands are
  156. described in the COMMANDS section below.
  157. Commands may be invoked in
  158. any of three ways:  the command subwindow, pull-down menus, and keystroke
  159. bindings.  The command subwindow is a small entry window that is
  160. displayed at the bottom of the \fBmx\fR window.  When it is displayed,
  161. commands may be entered there.  Pull-down menus appear in a bar at the
  162. top of the \fBmx\fR window, and may be invoked by pressing a mouse button
  163. over the menu name and releasing it over an entry in the menu.  Each menu
  164. entry has a command associated with it;  when the entry is invoked, the
  165. command is executed (see the \fBmenu\fP command for information on
  166. how to create and modify menus).  The third command invocation
  167. mechanism is through
  168. keystroke bindings:  certain keystrokes, or combinations of keystrokes,
  169. have commands associated with them.  When the keystroke sequence is typed,
  170. the associated command is executed (see the \fBbind\fP command for
  171. details).  For example, the ``a'' key
  172. is normally bound to the command \fBinsert a\fR, which causes
  173. character ``a'' to be inserted at the caret location.
  174. .LP
  175. Many commands may be invoked either through a menu entry or a keystroke
  176. binding;  for these commands, the keystroke sequence bound to the command
  177. appears at the right side of the menu entry.
  178.  
  179. .SH ".MX FILES"
  180. After processing command line options, opening the window, and reading
  181. in the file, \fBmx\fR checks for the existence of a file \fB.mx\fR in your
  182. home directory (which is given by the
  183. environment variable HOME).  If the file exists, \fBmx\fR
  184. reads it in and processes it as a command file, just as if it were read
  185. with the \fBsource\fP command.  Then it checks for an \fB.mx\fR file in the
  186. current directory, and processes it if it exists.
  187.  
  188. .SH CARET AND SELECTION
  189. The mouse may be used to position the caret (the insertion point)
  190. and to select ranges of text.  The same actions apply both to the file
  191. or to the search and command subwindows.
  192. Left-clicking on a character positions the caret just before
  193. that character.  Right-clicking will select all of the characters
  194. from the caret up to and including the character under the pointer.
  195. If the left button is clicked twice in quick succession without
  196. moving the mouse, it invokes word selection:  the word containing
  197. the character under the pointer is selected, the caret is positioned
  198. at the left side of the word, and future right clicks will select
  199. only full words.  If the left button is triple-clicked, line selection
  200. will be invoked.  If the control key is held down while left- and
  201. right-clicking, the selection will be set without changing the caret
  202. or input focus.
  203.  
  204. .SH "VARIABLES"
  205. .LP
  206. There are several Tcl global variables that are set or used by \fBmx\fR
  207. in some situations:
  208. .RS
  209. .TP
  210. \fBfile\fP
  211. Set by \fBmx\fR to the name of the file loaded in the window (which is
  212. the first name in \fB$files\fR.
  213. .VS
  214. .TP
  215. \fBfiles\fP
  216. Set by \fBmx\fR to a list of all the \fIfile\fR arguments specified on the
  217. command line that created the window.
  218. .VE
  219. .TP
  220. \fBgeometry\fP
  221. Geometry to use when creating new windows, if none is given as part
  222. of the \fBopen\fR command.  See the
  223. \fBopen\fP command for details.
  224. .TP
  225. \fBheight\fP
  226. Set by \fBmx\fR to indicate
  227. the height of the window, in lines of text.  If the last line
  228. appearing in the window is only partially visible, it doesn't count.
  229. .TP
  230. \fBhelpDir\fP
  231. \fBMx\fR presets this variable to the location of the directory containing
  232. help information such as the tutorials.
  233. .TP
  234. \fBhistory\fP
  235. \fBMx\fR automatically changes this variable on each mouse click to hold
  236. information about all the recently-executed commands.  Several of
  237. the default key bindings and menu entries also set this variable.
  238. See the HISTORY section and the \fBhistory\fR command for more
  239. information.
  240. .TP
  241. \fBnewWindow\fR
  242. During the \fBopen\fR command, \fBmx\fR sets this global variable to hold
  243. the id of the newly-created window.
  244. .TP
  245. \fBnoRegExps\fR
  246. If this variable is set to ``1'', searches and replaces will use plain
  247. strings.  By default, pattern matching takes place with vi-style regular
  248. expressions.
  249. .TP
  250. \fBreplaceCmd\fP
  251. When the middle button is clicked in the ``Replace'' string entry, or when
  252. carriage-return is typed there, the contents of this variable are
  253. executed as a command.
  254. .TP
  255. \fBreplaceString\fP
  256. Set by \fBmx\fR to hold the contents of the replacement entry subwindow.
  257. .TP
  258. \fBsearchCmd\fP
  259. When the middle button is clicked in the ``Search'' string entry, or when
  260. carriage-return is typed there, the contents of this variable are
  261. executed as a command.
  262. .TP
  263. \fBsearchString\fP
  264. Set by \fBmx\fR to hold the contents of the search entry subwindow.
  265. .TP
  266. \fBtagFiles\fP
  267. List of tags files to check in \fBtag\fP command, separated by
  268. white space.  See the \fBtag\fP command for details.  This variable
  269. is read by \fBmx\fR but not written.
  270. .TP
  271. \fBversion\fR
  272. .VS
  273. Set by \fBmx\fR to hold a version number in the form \fIx.y\fR, where
  274. changes in \fIx\fR correspond to major revisions with probable
  275. incompatibilities, and changes in \fIy\fR represent small bug fixes
  276. and upgrades that should not cause substantial compatibility problems.
  277. .VE
  278. .TP
  279. \fBwidth\fP
  280. The width of the window, in characters.  If the last character position
  281. is only partially-visible, then it doesn't count.  If a variable-width
  282. font is being used, the average character size is used in computing
  283. the window's width.
  284. .RE
  285.  
  286. .SH "MARKS"
  287. .PP
  288. A mark is a string that identifies a position in the file.  It
  289. has the format
  290. .DS
  291. \fIline\fB.\fIchar\fR
  292. .DE
  293. where \fIline\fR is a line number in the file and \fIchar\fR is
  294. a position within that line.  For historical reasons, lines
  295. number from 1 and characters number from 0.
  296. .PP
  297. Most commands that deal with positions in the file, such as
  298. \fBsee\fP and \fBdelete\fP, take marks as arguments.  Typically,
  299. marks are stored as the values of variables, although they may also be
  300. typed in directly.  The \fBmark\fP command provides for simple mark
  301. arithmetic.  The position indicated in a mark
  302. need not actually exist in the file;  at the time the mark is used it
  303. is rounded off to the closest actual position in the file.  For example,
  304. if the line number doesn't exist in the file then it is changed to
  305. the last line;  if the character position would like off the end of
  306. the line, then it is rounded to the position of the last character
  307. in the line.
  308. .LP
  309. When a command specifies that one of its arguments must be a mark,
  310. the mark may either be specified in the \fIline.char\fR form
  311. (either directly or through command or variable substitution),
  312. or it may be specified symbolically using one of the following names, which
  313. refer to special locations:
  314. .RSquit
  315. .TP
  316. \fBbottom\fP
  317. This special mark refers to
  318. the character that appears in the bottom left corner of the window.
  319. .TP
  320. \fBcaret\fP
  321. The special mark \fBcaret\fP corresponds to the character just to
  322. the right of the caret position.
  323. .TP
  324. \fBcenter\fP
  325. The leftmost character on the center line of the window.
  326. .TP
  327. \fBeof\fP
  328. The last character in the file (which is always a newline character).
  329. .TP
  330. \fBsel.left\fP
  331. The leftmost selected character.  This form of mark may only be used
  332. if the selection is in the file that's in this window.
  333. .TP
  334. \fBsel.right\fP
  335. The rightmost selected character.  This form of mark may only be used
  336. if the selection is in the file that's in this window.
  337. .TP
  338. \fBtop\fP
  339. The character that appears in the top left corner of the window.
  340.  
  341. .SH "HISTORY"
  342. Under normal circumstances,
  343. \fBMx\fR continuously records all the top-level commands being executed,
  344. including those coming from keystrokes, menu entries, and the command,
  345. search, and replace subwindows.
  346. On each button click, undo, or search operation, all of the recorded
  347. commands are saved in the variable \fBhistory\fR and the record is
  348. cleared.  Thus the \fBhistory\fR variable describes all the commands
  349. executed between the last two events in the above group.  It may
  350. then be invoked as a command to repeat recent actions.
  351. .PP
  352. Under normal circumstances, \fBmx\fR does not record information about
  353. mouse clicks,  searching, undoing, or \fBhistory\fR commands.
  354. In addition, changes of focus to the command, search, 
  355. or replace subwindows are not normally recorded.  Having these commands
  356. included in the \fBhistory\fR variable turns out to cause more trouble
  357. than good.  However, much of this behavior is enforced by using
  358. the \fBhistory\fR command in the key
  359. bindings and menus established by the \fBmx\fR startup file, so you can
  360. change it if you wish.  Only the mouse click behavior and \fBmx\fR's refusal
  361. to record \fBhistory\fR commands are hard-wired.  See the \fBhistory\fR
  362. command for information on how to control command recording.
  363.  
  364. .SH "COMMANDS"
  365. The \fBmx\fR built-in commands are described below.  In addition to these
  366. commands, any of the Tcl built-in commands may also be used.
  367. Whenever a top-level command is invoked (i.e. in response to a keystroke or
  368. menu selection, as opposed to the execution of a command procedure), if it
  369. returns a non-empty result then the result is displayed in the message
  370. window.  If the command returns an error then the error message is
  371. displayed in the message window.
  372. .TP
  373. \fBbind \fR[\fIsequence\fR [\fIcommand\fR]]
  374. If the \fIsequence\fR and \fIcommand\fR arguments are given,
  375. this command associates
  376. the keystroke sequence \fIsequence\fR with \fIcommand\fR and
  377. returns an empty string.
  378. From now on, whenever \fIsequence\fP is typed in the window,
  379. the Tcl interpreter will be invoked to execute \fIcommand\fP.
  380. If \fIsequence\fP is already bound to a command, then
  381. \fIcommand\fP replaces the previous binding.  If there are two bound
  382. sequences of which one is a prefix of the other, then the shorter
  383. sequence will always match in preference to the longer one.
  384. If \fIcommand\fR is an empty string, then the binding for \fIsequence\fR
  385. (if any) is deleted, leaving \fIsequence\fP unbound.
  386. .RS
  387. .PP
  388. If the first character of \fIcommand\fP is ``!'', it signifies that
  389. no undo marks are to be generated around this command;  the ``!'' is
  390. stripped from the command before executing it.  If several key bindings
  391. in a row are invoked and each had the ``!'' prefix, then all of the
  392. invocations will be undone together as a single unit.  If \fIcommand\fP
  393. consists of nothing but the character ``\fB@\fP'' (optionally preceded
  394. by ``!''), then whenever this
  395. binding is invoked the command ``\fBinsert \fIkey\fR'' will be executed,
  396. where \fIkey\fR is the last key typed on the keyboard.  ``\fB!@\fR''
  397. is typically used as the binding for all the standard ASCII
  398. characters.
  399. .PP
  400. If \fIcommand\fR isn't specified, then the \fIbind\fR command returns
  401. the current binding for \fIsequence\fR, or the empty string if there
  402. is no binding for \fIsequence\fR.  If neither \fIsequence\fR or \fIcommand\fR
  403. is given, then \fBbind\fR returns a Tcl list whose elements are the
  404. \fIsequence\fRs associated with all known keystroke bindings.
  405. .RE
  406. .TP
  407. \fBcaret \fImark\fR
  408. .TP
  409. \fBcaret display \fItype\fR
  410. .VS
  411. In the single-argument form of this command, the caret is moved to
  412. just before the character at the position given by \fImark\fP.
  413. The two-argument form is used to change the way the caret position
  414. is displayed.  If \fItype\fR is \fBcaret\fR, the caret position will
  415. always be marked by displaying a caret just before the caret
  416. character.  If \fItype\fR is \fBblock\fR, the
  417. caret position will be marked by displaying the caret character in
  418. reverse video.  If \fItype\fR is \fBoff\fR, then the caret position
  419. will not be marked with any sort of special display.  Finally, a \fItype\fR
  420. of \fBviblock\fR marks the caret position with a block when in vi mode
  421. and with a caret otherwise (this mode is only relevant for \fBtx\fR).
  422. The \fBcaret\fR command returns an empty string.
  423. .VE
  424. .TP
  425. \fBclean\fR
  426. Pretend that the contents of this window were just written to disk (but
  427. don't actually write anything).  Until the next time the file is
  428. modified, \fBmx\fR will assume that the window is ``clean'':  if you invoke
  429. commands like \fBquit\fR or \fBswitch\fR then \fBmx\fR will happily discard the
  430. contents of the window without warning you or giving you a chance to
  431. abort the command.
  432. .TP
  433. \fBcolumn \fImark\fR
  434. Return the column corresponding to the left edge of the character
  435. at the position indicated by \fImark\fR.  \fIMark\fR must be a valid
  436. mark.  Columns are computed by treating normal characters as one
  437. column wide, control characters as two columns wide, and tabs as
  438. wide enough to extend up to the next 8-column boundary.  Character 0
  439. of a line is at column 0.
  440. .TP
  441. \fBcontrol \fIoption string\fP
  442. This command performs control-character processing on \fIstring\fR,
  443. depending on the value of \fBoption\fR (abbreviations are OK):
  444. .RS
  445. .TP
  446. \fBcontrol backslash \fIstring\fR
  447. Returns a string that is identical to \fIstring\fR except that
  448. non-printing characters are replaced with backslash sequences.
  449. The newline control character is replaced with \fB\en\fR, tab is
  450. replaced with \fB\et\fR, backspace is replaced with \fB\eb\fR, and
  451. any other non-printing character is replaced with \fB\e\fIddd\fR
  452. where \fIddd\fR gives the octal value of the character.
  453. .TP
  454. \fBcontrol binding \fIstring\fR
  455. This command is used primarily to produce a printable description of
  456. a keystroke sequence that is bound to a command.  It returns a string
  457. consisting of space-separated fields corresponding to the characters
  458. of \fIstring\fR.  If a \fIstring\fR character is space, its
  459. corresponding field is ``SPACE'';  if the \fIstring\fR character
  460. is a normal printing character then the field is just that
  461. character;  if the \fIstring\fR character is
  462. rubout (177\d\s-18\s+1\u) the corresponding field is ``DEL'';
  463. if the \fIstring\fR character is a control character, the
  464. corresponding field is of the form ``C-a''; if the \fIstring\fR
  465. character has its high-order bit set (200\d\s-1\8\s+1\u), then the
  466. field is the same as if the high-order bit were not set, except that
  467. ``M-'' is prepended (301\d\s-1\8\s+1\u translates to ``M-A'').
  468. .TP
  469. \fBcontrol make \fIstring\fR
  470. Returns a string of the same length as \fIstring\fR.  Each character in
  471. the result is the control equivalent
  472. of the \fIstring\fR character (e.g., ``a'' and ``A''
  473. convert to control-A).  The character ``?'' converts to
  474. rubout (177\d\s-1\8\s+1\u).
  475. You may not use this command to generate a null character (0).
  476. .RE
  477. .TP
  478. \fBdelete\fR \fImark1 \fR[\fImark2\fR [\fBnoviewchange\fR]]
  479. Delete all of the characters between \fImark1\fP and \fImark2\fP,
  480. inclusive.  If \fImark2\fR isn't specified, then delete the single
  481. character at \fImark1\fR.  Normally, this command changes the
  482. view in the window if necessary to ensure that the point of the
  483. deletion is visible;  if \fBnoviewchange\fR is specified then
  484. the view in the window will not be changed.  Returns an empty string.
  485. .TP
  486. \fBextract\fR \fImark1 \fR[\fImark2\fR]
  487. Return as result all of the characters in the file between the two
  488. marks \fImark1\fR and \fImark2\fR.  If \fImark2\fR is omitted, then
  489. return the single character at \fImark1\fR.
  490. .TP
  491. \fBfocus \fIwindow \fR[\fBclear\fR]
  492. Arrange for all future keyboard input to be directed to \fIwindow\fR,
  493. regardless of the mouse position.  \fIWindow\fR must have one of the
  494. following values (or a unique abbreviation for it):
  495. .RS
  496. .TP
  497. \fBcommand\fR
  498. The command window that appears at the bottom of the file.
  499. .TP
  500. \fBfile\fR
  501. The main window, which displays the file being edited.
  502. .TP
  503. \fBreplace\fR
  504. The replace entry, which is part of the search/replace window that
  505. appears just underneath the menu bar.
  506. .TP
  507. \fBsearch\fR
  508. The search entry in the search/replace window.
  509. .RE
  510. .IP
  511. If \fIwindow\fR isn't displayed when this command is invoked, \fBmx\fR
  512. displays it.  Ifthe \fBclear\fR option is specified (or any
  513. abbreviation of \fBclear\fR) then the contents of the given window
  514. are cleared.  The \fBclear\fR option is ignored if \fIwindow\fR
  515. is \fBfile\fR.  If input focussing has been disabled by the .Xdefaults
  516. file, then \fBfocus\fR will open and/or clear \fIwindow\fR, but will
  517. not focus on it.  Returns an empty string.
  518. .TP
  519. \fBgeometry \fIspec\fR
  520. Set the size and/or location of the window according to the information
  521. in \fIspec\fR.  \fISpec\fR should be in the standard format for X geometry
  522. specifications (\fB=80x24\fR, for example).  Returns an empty string.
  523. .TP
  524. \fBhistory\fR \fIoption\fR [\fIarg\fR]
  525. Control the history recording process.  The exact function
  526. depends on \fIoption\fR (which may be abbreviated uniquely):
  527. .RS
  528. .TP
  529. \fBhistory add \fIinfo\fR
  530. Append \fIinfo\fR to the current history record as if it had been
  531. invoked as a command.  Returns an empty string.
  532. .TP
  533. \fBhistory clear\fR
  534. Discard all of the information in the current history record.
  535. Returns an empty string.
  536. .TP
  537. \fBhistory ignore \fIcommand\fR
  538. Execute \fIcommand\fR but don't record it in the history record.
  539. Note that no \fBhistory\fR commands are ever recorded, even if they don't
  540. appear as the \fIcommand\fR argument to \fBhistory ignore\fR.
  541. Returns an empty string.
  542. .TP
  543. \fBhistory info\fR
  544. Returns the current history record, with commands separated by
  545. newlines.
  546. .TP
  547. \fBhistory next \fIvarName\fR [\fIcommand\fR]
  548. Store the current history record in the variable \fIvarName\fR,
  549. then clear the history record.  After clearing the history
  550. record, if \fIcommand\fR is specified then execute it but don't
  551. record it.  Returns an empty string.
  552. .TP
  553. \fBhistory off\fR
  554. Disable history recording.  Invocations of \fBhistory off\fR
  555. nest:  recording will not resume until an equal number of
  556. \fBhistory on\fR commands have been invoked.  Returns an empty string.
  557. .TP
  558. \fBhistory on\fR
  559. Re-enable history recording if the cumulative number of \fBhistory on\fR
  560. commands is greater than or equal to the number of \fBhistory off\fR
  561. commands.  This command is ignored if history recording is already
  562. enabled.  Returns an empty string.
  563. .RE
  564. .TP
  565. \fBindent\fR \fImark1 mark2\fR [\fB+\fR|\fB\-\fR] \fIamount\fR
  566. Change the indentation of all the lines between \fImark1\fP
  567. and \fImark2\fP, inclusive.  If no sign is given, then \fIamount\fP
  568. specifies an absolute indentation:  for each of the lines,
  569. the indentation will be set to \fIamount\fP.  If \fIamount\fP is
  570. preceded by a minus (plus) argument, then the indentation of each line will be
  571. reduced (increased) by \fIamount\fP units.
  572. To set the indentation for a line to \fIi\fP, \fBmx\fR deletes all the
  573. leading blanks and tabs in the line, then inserts \fIi\fP/8 tabs followed
  574. by (\fIi\fP mod 8) spaces.  Returns an empty string.
  575. .TP
  576. \fBinsert\fR \fIbytes\fR [\fImark\fR]
  577. If \fImark\fR is specified, it contains a mark;  \fBinsert\fR
  578. will insert the contents of the \fIbytes\fR
  579. argument just before the character at position \fImark\fR.  Otherwise
  580. the command will insert \fIbytes\fR at the position of the caret.
  581. Returns an empty string.
  582. .TP
  583. \fBmark\fI src op args\fR
  584. Return a position in the file in the form \fIline.char\fR, where
  585. \fIline\fR is a line in the file and \fIchar\fR is a character in
  586. the line (lines number from 1, characters from 0).
  587. \fISrc\fR must be a valid mark;
  588. the return value is computed
  589. by performing some operation on the position given by \fIsrc\fP,
  590. depending on \fIop\fR and \fIargs\fR:
  591. .RS
  592. .TP
  593. \fBmark \fIsrc\fR
  594. Return the value of mark \fIsrc\fR.  This form is used to retrieve
  595. the value of a built-in mark such as \fBsel.left\fR.
  596. .TP
  597. \fBmark \fIsrc direction amount units\fP
  598. Return the position of
  599. the character \fIamount units\fP away from \fIsrc\fP.  \fISrc\fP
  600. must be a valid mark.  \fIDirection\fP
  601. must be \fBforward\fP or \fBbackward\fP; it indicates which direction
  602. to move from \fIsrc\fP.  \fIAmount\fP is a decimal number indicating
  603. how far to move, and \fIunits\fP indicates the units for motion:
  604. \fBchars\fP, \fBwords\fP, or \fBlines\fP.  For example,
  605. \fBmark $b forward 1 word\fP will set variable \fBa\fP to
  606. point to the beginning of the word just after the one containing
  607. the position indicated by variable \fBb\fP.
  608. .TP
  609. \fBmark \fIsrc \fBchar \fIindex\fR
  610. Return the position of the \fIindex\fP'th character in the line
  611. given by \fIsrc\fP.  If \fIindex\fR is -1, then \fIdst\fP will
  612. refer to the last character on \fIsrc\fR's line.
  613. .TP
  614. \fBmark \fIsrc \fBcolumn \fIindex\fR
  615. Return the position of the character that covers column \fIindex\fR
  616. on the line containing \fIsrc\fR.  Columns are computed by treating
  617. normal characters as one space wide, control characters as two
  618. spaces wide, tabs as wide enough to extend up to the next 8-column
  619. boundary, and the newline at the end of the line as infinitely wide.
  620. Columns number from 0.
  621. .TP
  622. \fBmark \fIsrc \fBline \fIindex\fR
  623. Return the position whose line number is \fIindex\fP but whose
  624. character position is the same as \fIsrc\fP's.
  625. .TP
  626. \fBmark \fIsrc \fBparenthesis\fR [\fIvarName\fR]
  627. Return the position of the first character of the
  628. parenthesis that matches the one pointed
  629. to by \fIsrc\fP.  If \fIsrc\fP doesn't point to a parenthesis, then
  630. return \fIsrc\fP.  If \fIvarName\fP
  631. is specified, then it names a variable that is set to refer to the
  632. last character of the matching parenthesis (this feature is only useful
  633. for parentheses that are more than one character long).
  634. .TP
  635. \fBmark \fIsrc \fBsearch \fIdirection pattern\fR [\fIvarName\fR]
  636. Search for \fIpattern\fP and return the position of the first character
  637. of the matching range.  If \fIvarName\fP is given, it names a
  638. variable that is set to the
  639. last character of the matching range.  The search starts at the
  640. position given by \fIsrc\fP and continues in \fIdirection\fP,
  641. which must be either \fBforward\fP or \fBbackward\fP.  The search
  642. is circular:  if a forward search reaches the end of the file then
  643. it continues at the beginning;  if a backward search reaches the
  644. beginning of the file then it continues at the end.  If no match
  645. is found, then \fIsrc\fR is returned (and stored in the variable
  646. named by \fIvarName\fP, if specified).
  647. .RE
  648. .TP
  649. \fBmenu\fI option \fR[args\fR]
  650. The \fBmenu\fP command is used to manipulate the pull-down menus
  651. displayed at the top of the window.  It has several forms, depending
  652. on \fIoption\fP:
  653. .RS
  654. .TP
  655. \fBmenu append \fIname leftText centerText rightText color cmd\fR
  656. Append a new entry onto menu \fIname\fR, which must already exist.
  657. The \fIleftText\fP,
  658. \fIcenterText\fP, and \fIrightText\fP arguments give strings to be
  659. displayed left-justified, centered, and right-justified (respectively)
  660. in the menu entry.  If any of the arguments is an empty string or the
  661. single character ``-'', then no text is displayed in that position.
  662. \fIColor\fP gives the background color to use for the entry;  if it is
  663. an empty string or ``-'' then the standard background color for the
  664. window is used.  \fICmd\fP is a command to invoke whenever the menu
  665. entry is invoked.  Returns an empty string.
  666. .TP
  667. \fBmenu create \fIname leftText centerText rightText color cmd leftText ...\fR
  668. Create a new menu, which will be displayed to the right of any existing
  669. menus in the menu bar.  The new menu's name will be \fIname\fP.  If there is
  670. already a menu named \fIname\fR, then it will be replaced (the new menu
  671. will occupy the same position in the menu bar as the old menu).
  672. Following the \fIname\fP
  673. argument are any number of groups of five arguments, with each group
  674. describing one entry in the new menu from top down. The five arguments
  675. for each menu entry have the same meaning as for \fBmenu append\fP.
  676. Returns an empty string.
  677. .TP
  678. \fBmenu delete \fIname\fP
  679. Delete the menu named \fIname\fP and return an empty string.
  680. .TP
  681. \fBmenu info\fR
  682. Return a Tcl list whose entries are the names of the menus for this
  683. window, in order.
  684. .TP
  685. \fBmenu info \fIname\fR
  686. Returns a Tcl list containing information about menu \fIname\fR.  Each entry
  687. in the list corresponds to one entry in the menu, in order from top
  688. down.  Each entry is itself a Tcl list with four entries, which
  689. are the \fIleftText\fR, \fIcenterText\fR, \fIrightText\fR, and \fIcmd\fR
  690. values from \fBmenu create\fR or \fBmenu append\fR.
  691. .TP
  692. \fBmenu modify \fIname entryIndex leftText centerText rightText color cmd\fR
  693. Change the \fIentryIndex\fR'th entry in menu \fIname\fP as indicated
  694. by arguments \fIleftText\fP through \fIcmd\fP.  Each of these five
  695. arguments has the same meaning as in \fBmenu append\fP.  Entry 0 is
  696. the topmost entry in the menu.  Returns an empty string.
  697. .RE
  698. .VS
  699. .TP
  700. \fBmessage \fIstring\fR
  701. Display \fIstring\fR in the message subwindow.
  702. .VE
  703. .TP
  704. \fBnewline\fP
  705. Insert a newline character at the position of the caret, and
  706. adjust indentation.  If the caret's initial line
  707. consists of nothing but space, then all the space on the line is
  708. deleted.  If the caret's initial line contains leading space, it
  709. is reorganized to consist of zero or more tabs followed by zero or
  710. more space characters, such that the total width of white space is
  711. the same after the change as before (a tab counts for eight characters).
  712. Tabs and spaces are inserted on the caret's new line to match the
  713. indentation of the caret's initial line.
  714. .TP
  715. \fBopen \fR[\fIoptions\fR] \fIfile\fR \fIfile\fR ...
  716. .VS
  717. Open a new window.  \fIOptions\fR and
  718. \fIfile\fR arguments are treated just the same as they are treated
  719. on the command line, except for the following exceptions.  The \fB-D\fR
  720. option is not permitted, nor are options that specify a display.
  721. If \fIfile\fR is not specified, a new window is opened on the same
  722. file as the current window.  If no geometry specification is given in
  723. \fIoptions\fR, then \fBmx\fR uses the contents of the global variable
  724. \fBgeometry\fP as a default geometry;  if no \fBgeometry\fP variable
  725. exists, then \fBmx\fR picks a default geometry.  Other options, such
  726. as foreground color and font, default to the values from the invoking
  727. window, rather than looking for X defaults.
  728. \fBOpen\fR sets the global variable
  729. \fBnewWindow\fR in the invoking window
  730. to hold the id of the newly-created window.  This may
  731. be used in conjunction with the \fBsend\fR command to issue commands
  732. to the new window.  The return value is always an empty string.
  733. .VE
  734. .TP
  735. \fBquit\fP
  736. Destroy the window.  If this is the last remaining window on its file
  737. and if the file has been modified since the last time it was written,
  738. then the user is notified and given a chance to save the file or
  739. abort the command.  This command always returns an error, in order to
  740. abort any partially-executed commands that are in progress (execution
  741. of further commands on the window could cause a core dump).
  742. .TP
  743. \fBquote\fP
  744. .VS
  745. Quote the next input character.  The mapping for the next character will
  746. be ignored and the character will be inserted.  The return value is always
  747. an empty string.
  748. .VE
  749. .TP
  750. \fBread \fIfile\fR
  751. Read \fIfile\fP and insert its contents just before the caret.
  752. .TP
  753. \fBreplace \fR[\fIoption args\fR]
  754. Replace the selection, as determined by \fIoption\fR and \fIargs\fR:
  755. .RS
  756. .TP
  757. \fBreplace\fP
  758. If no \fIoption\fP is given, then replace the selection by the value
  759. of the \fBreplaceString\fP global variable.  If the
  760. search subwindow isn't visible, don't do any replacement but open
  761. the search subwindow and focus input on the replacement string entry.
  762. .TP
  763. \fBreplace range\fR \fIstart stop\fR [\fIpattern string\fR]
  764. Search the range of text between the marks \fIstart\fR and \fIstop\fR,
  765. inclusive for occurrences of \fIpattern\fP.
  766. Replace each occurrence with
  767. \fIstring\fP.  If \fIpattern\fP and \fIstring\fP aren't specified, then
  768. they are taken from the \fBsearchString\fP and \fBreplaceString\fR
  769. global variables.  If the search subwindow isn't visible, don't
  770. do any replacement but open the search subwindow and focus input
  771. on the replacement string entry.
  772. .VS
  773. By default, vi-style regular expressions are used for the pattern and
  774. replacement strings.
  775. If the variable ``noRegExps'' is set to ``1'', only simple matching is done:
  776. there are no wild cards.
  777. Matches must be within a single line of the file.
  778. .VE
  779. .TP
  780. \fBreplace selection \fIstring\fP
  781. Delete the selection and insert \fIstring\fP in its place.
  782. .RE
  783. The \fBreplace\fR command always returns an empty string.
  784. .TP
  785. \fBreset\fR
  786. .VS
  787. Discard the version of the file that is currently loaded in memory and
  788. re-load the file from its disk version.  Any changes that have been
  789. made since the last time the file was saved will be lost (but you'll
  790. be warned in this case and given a chance to skip the command).  This
  791. command will affect all of the windows open on the file.
  792. .VE
  793. .TP
  794. \fBsearch \fR[\fIdirection \fR[\fIpattern\fR]]
  795. Search for a pattern.  The search starts from the beginning of
  796. the selection (if there is a selection in the window's file),
  797. or from the caret if there's no selection.  \fIDirection\fR indicates which
  798. direction to search, and must be either \fBforward\fR or
  799. \fBbackward\fR.  If omitted, it defaults to \fBforward\fR.
  800. \fIPattern\fP gives a text string to search for;  if not
  801. given, it defaults to the global variable \fBsearchString\fP.  If the
  802. search subwindow isn't visible, don't do any searching but open the
  803. search subwindow and focus input on the search string entry.
  804. .VS
  805. By default, vi-style regular expressions are used for the pattern and
  806. replacement strings.
  807. If the variable ``noRegExps'' is set to ``1'', only simple matching is done:
  808. there are no wild cards.
  809. Matches must be within a single line of the file.
  810. .VE
  811. If a match is found, the matching range is selected and the caret
  812. is set to the beginning of the range.  Returns an empty string.
  813. .TP
  814. \fBsee \fImark\fP [\fBtop\fR|\fBcenter\fR|\fBbottom\fR]
  815. Adjust the view in the window so that the character at \fImark\fP
  816. is visible in the window.  If a \fBtop\fR or \fBcenter\fR or \fBbottom\fR
  817. option is given, then the mark will appear at the given position in
  818. the window.  If no position is given, then \fBmx\fR will check to see if
  819. \fImark\fR is already visible.  If so, it does nothing.  If not, it
  820. will center \fImark\fR in the window.  Returns an empty string.
  821. .TP
  822. \fBselection \fIoption \fR[\fIarg ...\fR]
  823. This command performs one of several selection-related operations,
  824. depending on \fIoption\fR:
  825. .RS
  826. .TP
  827. \fBselection\fR
  828. .TP
  829. \fBselection get\fR
  830. If \fBselection\fR is invoked with no \fIoption\fR, or if \fIoption\fR
  831. is \fBget\fR, then the command returns the contents of the selection.
  832. An error occurs if there's nothing selected.  The command \fBselection\fR
  833. is different from the command \fIextract sel.left sel.right\fR:
  834. \fBselection\fR will return the contents of the selection even if
  835. the selection is in another window, but
  836. \fBextract sel.left sel.right\fR can only return
  837. information from this window.
  838. .TP
  839. \fBselection clear\fR
  840. .VS
  841. If there is something selected in this window, the selection is cleared,
  842. so nothing will be selected.  If there is nothing selected in this window,
  843. there is no effect.  Returns an empty string.
  844. .VE
  845. .TP
  846. \fBselection here\fR
  847. Returns \fB1\fR if there is something selected in the file in this window.
  848. Returns \fB0\fR if there is no selection or if the selection is not in
  849. this window's file.
  850. .TP
  851. \fBselection set \fImark1 \fR[\fImark2\fR]
  852. Change the selection to consist of the characters between \fImark1\fP
  853. and \fImark2\fP, inclusive.  If \fImark2\fR isn't specified,
  854. then select the single character at \fImark1\fR.  Returns an empty string.
  855. .RE
  856. .TP
  857. \fBsend \fIwindow command\fR
  858. \fIWindow\fR must be the id of another window owned by this \fBmx\fR process
  859. (such as a value placed in \fBnewWindow\fR by \fBopen\fR).  The \fBsend\fR
  860. command will invoke the Tcl interpreter to process \fIcommand\fR in
  861. the context of \fIwindow\fR, rather than the window from which the
  862. \fBsend\fR command was issued.  \fBSend\fR will return the result
  863. of executing \fIcommand\fR in \fIwindow\fR.
  864. .TP
  865. \fBswitch \fIfileName\fR
  866. Change the window to display \fIfileName\fR instead of what's there
  867. currently.  If the file currently in the window has been modified, and
  868. if this is the only window on the file, then a notifier is popped up
  869. to warn the user and give him/her a chance to abort the command.
  870. .TP
  871. \fBtaginfo \fIname\fR
  872. Look up \fIname\fP in the tags file(s).  If
  873. it is found, then return a Tcl list whose first element is the file
  874. containing \fIname\fR and whose second element is a search pattern
  875. identifying the tag's location in the file.
  876. If the global variable \fBtagFiles\fR is defined, it must contain a list of
  877. tags files to check.  Those files will be
  878. checked for \fIname\fP in order.  If no \fBtagFiles\fP variable exists,
  879. then the file \fBtags\fP in the current directory is searched.
  880. .TP
  881. \fBundo \fR[\fBmore\fR]
  882. .TP
  883. \fBundo recover \fIfileName\fR
  884. Undo recent edits.  If \fBundo\fR is invoked without any arguments,
  885. the most recent modification to the file is undone;  multiple
  886. invocations will toggle the change.  If the
  887. \fBmore\fR argument is given, successive undo's work back through
  888. history;  successive \fBundo more\fP commands will undo every change
  889. back to the beginning of the edit session.  Modifications are undone
  890. in groups delimited by marks in an undo log;  normally,
  891. a mark is placed in the log before and after each user-invoked action
  892. (button click, menu selection, or keystroke) that modifies the file.
  893. Exceptions to this rule occur for keystrokes whose bindings have the
  894. ``!'' prefix:  no marks are placed in the log for these actions.
  895. Returns an empty string.  If the \fBrecover\fR option is given, 
  896. then \fIfileName\fR must be the address of a \fBmx\fR log.  This command
  897. will read \fIfileName\fR, which describes changes made in a previous
  898. edit session, and apply those changes to the current file.
  899. .TP
  900. \fBupdate\fR
  901. Force the screen to get updated.  Normally the screen is updated only
  902. at the end of processing a command, just before waiting for more input
  903. from the user.  This command will force any pending redisplays to
  904. be performed immediately.  It's used mostly for debugging.
  905. Returns an empty string.
  906. .TP
  907. \fBwrite \fR[\fIfileName\fR]
  908. Write the file to disk.  If \fIfileName\fR is given then the
  909. file is written there;  otherwise it is written to the place from
  910. which it was read (i.e. the name displayed in the window's title
  911. bar).  Returns a message containing the file's name and number of
  912. lines.
  913.  
  914. .SH "COMMAND PROCEDURES"
  915. In addition to the built-in commands described above, a number of Tcl
  916. command procedures are created by the default \fBmx\fR startup file.  They
  917. may be invoked just like built-in commands, and are described below.
  918. .TP
  919. \fBcaretinfo\fR
  920. Returns a string containing information about the file's length and
  921. the position of the caret.
  922. .TP
  923. \fBline \fIi\fR
  924. Selects line number \fIi\fR and adjusts the view in the window so that
  925. the line number is visible.  Returns an empty string.
  926. .TP
  927. \fBmove\fR
  928. This command moves the contents of the selection to the caret position.
  929. Returns an empty string.
  930. .TP
  931. \fBnext\fR
  932. .VS
  933. This command switches to the next \fIfile\fR of those specified on the
  934. command line by deleting the first element of the variable \fB$files\fR
  935. and switching the window to the new first element of \fB$files\fR.
  936. .VE
  937. .TP
  938. \fBshowBindings \fIbinding binding ...\fR
  939. Open a scratch window and display information about keystroke
  940. bindings in it.  If
  941. no \fIbinding\fR argument is given, then display information about all
  942. of the keystroke bindings that are currently defined.
  943. If one or more \fIbinding\fR arguments are given, then
  944. just display information for the given bindings.
  945. Returns an empty string.
  946. .TP
  947. \fBshowMenus \fIname name ...\fR
  948. Open a scratch window and display information about menus in it.  If
  949. no \fIname\fR argument is given, then display information for all the
  950. menus that are currently defined.
  951. If one or more \fIname\fR arguments are given, then
  952. just display information for the named menus.
  953. Returns an empty string.
  954. .TP
  955. \fBshowProcs \fIname name ...\fR
  956. Open a scratch window and display procedure information in it.  If
  957. no \fIname\fR argument is given, then display information about all
  958. the procedures that are currently defined.
  959. If one or more \fIname\fR arguments are given, then
  960. just display information for the named procedures.
  961. Returns an empty string.
  962. .TP
  963. \fBshowVars \fIname name ...\fR
  964. .VS
  965. Open a scratch window and display variable values in it.  If
  966. no \fIname\fR argument is given, then display the values of all
  967. variables known in the context of the caller of \fBshowVars\fR.
  968. If one or more \fIname\fR arguments are given, then
  969. just show the values of those variables. Returns an empty string.
  970. .VE
  971. .TP
  972. \fBtag \fIname\fR
  973. Invoke the \fBtaginfo\fR command to look up \fIname\fR, then open
  974. a new window on its file, select the definition of \fIname\fR,
  975. and make the selected line visible in the new window.
  976. Returns an empty string.
  977. .TP
  978. \fBwhere\fR
  979. .VS
  980. Open a scratch window and display information about where the
  981. last error occurred.  The error information is taken from the
  982. \fBerrorInfo\fR global variable.
  983. .VE
  984.  
  985. .SH "COMMAND SUBWINDOW"
  986. The command subwindow allows commands to be typed in directly,
  987. instead of invoking them through keystroke bindings or menus.
  988. When active, it appears at the bottom of the \fBmx\fR window.  It can
  989. be activated with the \fBcommand\fR or \fBfocus\fR commands.
  990. Commands may be entered and
  991. edited in the command subwindow, and are invoked by typing
  992. carriage-return or by middle-clicking in the window.  When a command
  993. is invoked, it is not deleted from the command subwindow, in order
  994. to permit it to be re-invoked easily.  The
  995. command window is de-activated by typing \fB^Q\fR in it.
  996.  
  997. .SH "SEARCH SUBWINDOW"
  998. The search subwindow is used to enter search and replacement strings.
  999. When active, it appears at the top of the \fBmx\fR window, just underneath
  1000. the menu bar.  If it isn't active and a search or replacement command
  1001. is invoked that requires one of its entries, then the window is
  1002. activated.  It may also be activated using the \fBfocus\fR
  1003. command.  The top entry in the window is used to enter a search
  1004. pattern and the bottom entry is used to enter a replacement string.
  1005. The values of these two entries are always available in the \fBsearchString\fR
  1006. and \fBreplaceString\fR global variables, respectively.
  1007. If carriage-return is typed in the ``Search:'' entry, or if the middle
  1008. mouse button is clicked in the entry, then the the contents of the
  1009. global variable \fBsearchCmd\fR are invoked as a Tcl command.
  1010. If carriage-return is typed in the ``Replace:'' entry, or
  1011. if it is middle-buttoned, then the contents of the global variable
  1012. \fBreplaceCmd\fR are invoked as a Tcl command.
  1013. The search subwindow can be deactivated by typing \fB^Q\fR in it.
  1014.  
  1015. .SH KEYWORDS
  1016. editor, mouse, window
  1017.